﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebShopAPI.Models;
using DAL;
using Models;
namespace WebShopAPI.Controllers
{
    /// <summary>
    /// 商品的SKU相关web API
    /// </summary>
    public class productController : ApiController
    {
        sp_ProductServcie sp_productService = new sp_ProductServcie();

        #region 查询出该商品的SKU货品信息
        public ResponData Get(int goodId)
        {
            // 数据处理部分在数据访问层或业务层完成
            List<sp_Product> productList = sp_productService.GetAllProductByGoods(goodId);
            //
            ResponData rd = new ResponData();
            rd.data = productList;
            rd.meta.msg = "获取产品列表成功";
            rd.meta.status = 200;
            return rd;
                
        }
        #endregion
    }
}
